package brands

import (
	"context"
	"device_srv/device"
	"device_srv/internal/dao"
	"device_srv/internal/svc"
	"github.com/zeromicro/go-zero/core/logx"
)

type BrandsListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewBrandsListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BrandsListLogic {
	return &BrandsListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// BrandsList 品牌信息列表展示
func (l *BrandsListLogic) BrandsList(in *device.BrandsListRequest) (*device.BrandsListResponse, error) {
	//调用业务逻辑
	list, err := dao.BrandsList(in)
	if err != nil {
		return nil, err
	}
	return &device.BrandsListResponse{List: list}, nil
}
